<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no">
	   	<title>课程管理</title>
	    <link href="/static/weike/css/style.css" rel="stylesheet">
	    <script src="/static/weike/js/style.js"></script>
	    <script src="/static/js/jquery.js"></script>
	    <script src="/static/js/dialog/layer.js"></script>
	    <script src="/static/js/dialog.js"></script>
	    <script>
	    	function delet(butto){
	    		var art = document.getElementsByClassName("all_show_art")[0],
	    			sec = art.getElementsByTagName("section");
	    			if(confirm("是否删除此课程")){
	    				var data={};
	    				var url ="http://mg.bonayiyou.com/index/home/del_room";
	    				data['room_id']=$(butto).attr('name');
	    				$.post(url,data,function(e){
                        if(e.code==1)
                        {
                        	alert("删除成功");
                        }
                        else
                        {
                        	alert("操作失败");
                        }
	    				},"JSON");
	    				art.removeChild(butto.parentNode.parentNode);
	    			}else{
	    				
	    			}
	    	}
	    	//编辑房间信息
	    	function edit(butto)
	    	{
                
	    		var url ="http://mg.bonayiyou.com/index/home/person_updateobj?room_id="+$(butto).attr('name');
	    		window.location.href=url;
	    	}	       
	    </script>
	</head>
	<body class="person_center">
		<footer class="fixed">
			<section onclick="javascript:window.location.href='http://mg.bonayiyou.com/index/home/home.html'"><div></div><p>首页</p></section>
			<section onclick="javascript:window.location.href='http://mg.bonayiyou.com/index/home/weike_center.html'"  id="f_click"><div></div><p>微课中心</p></section>
			<section onclick="javascript:window.location.href='http://mg.bonayiyou.com/index/home/person_center.html'" ><div></div><p>我的</p></section>
		</footer>
		<article class="person_manaobj">
			<article class="all_show_art">
			    {volist name="room" id="vo"}
				<section>
					<div onclick="javascript:">
						<div>
							<img src="{$vo.cover}"/>
						</div>
					<article>
						<h5>{$vo.title}...</h5>
						<p>讲师:{$vo.teachername}</p>
						<p><span>{$vo.zhuangtai}</span><span>{$vo.popul_num|add_wan}人气</span><span>￥{$vo.room_price|money_baoliu}</span></p>
					</article>
					</div>
					<div><button onclick="delet(this)" name="{$vo.room_id}" >删除</button><button onclick="edit(this)" name="{$vo.room_id}" >编辑</button></div>
				</section>
				{/volist}
			</article>
		</article>
	</body>
</html>
